<?php
/**
 * @note 失败返回
 */
function errMsg($msg = 'get success!', $code = -1)
{
    return json(['code' => $code, 'msg' => $msg]);
}
function successMsg($msg = '', $data = null, $code = 1, $type = null, array $header = [])
{
    return json([$msg, $data, $code, $type, $header]);
}